<!--计划管理->需求计划->计划运算向导-->
<template>
    <div class="content-wrapper a-base-container">
        <div class="requisition-set-wrapper">
            <!--按钮-->
            <div class="btn-wrapper clearfix">
                <btns-wrapper @searchClick="searchClick" :showModel="showModel" :orderId="orderId" :voucherState="voucherState" :editMask="editMask" @printOrder="printOrder" @switchList="switchList" @submitServer="submitServer" @clickEdit="clickEdit" @deleteOrder="deleteOrder" @getIdByData="getIdByData" @auditClick="auditClick" @turnThePage="turnThePage" @syncOrder="syncOrder" @submitOrder="submitOrder" @exportDetail="exportDetail" :sourceCode="sourceCode">
                    <template slot="neworder">
                        <a-dropdown class="btns" key="new" style="display:block">
                            <a class="ant-dropdown-link" @click="e => e.preventDefault()">
                                <a-icon class="btns-icon" type="file-add" />
                                <div class="btns-text">新增
                                    <a-icon type="down" style="color:rgb(24,144,255);vertical-align:middle;" />
                                </div>
                            </a>
                            <a-menu slot="overlay">
                                <a-menu-item key="0">
                                    <a href="javascript:void(0)" @click="choiceChange(1)">从销售订单</a>
                                </a-menu-item>
                                <a-menu-item key="1">
                                    <a href="javascript:void(0)" @click="choiceChange(3)">从主生产计划</a>
                                </a-menu-item>
                            </a-menu>
                        </a-dropdown>
                    </template>

                    <template slot="yunsuan">
                        <span style="cursor:pointer;" @click="startOperation" v-if="permissions.includes('productionDemand:operation')">
                                <a-button type="primary" style=""><a-icon type="caret-right" />开始运算</a-button>
                            </span>
                    </template>
                </btns-wrapper>
            </div>
            <div ref="print" class="documents-wrapper" id="documents-wrapper">
                <h3 class="text-center">
                    {{voucherTitle}}
                </h3>
                <section class="demand-content" v-show="showModel=='order'">
                    <a-row :span="24" class="order-dynamic-form-wrapper">
                        <a-from>
                            <a-col :xs="grid.xs" :sm="grid.sm" :md="grid.md" :lg="grid.lg" :xl="grid.xl" :xxl="grid.xxl">
                                <a-form-model-item :label-col="labelCol" :wrapper-col="wrapperCol" label="单据编号：" :rules="[{ required: true, message:'',trigger:'input'}]">
                                    <a-input v-model="mrpCode"></a-input>
                                </a-form-model-item>
                            </a-col>
                            <a-col :span="6">
                                MRP运算方案：
                                <a-select style="width:150px;" placeholder="请选择运算方案" showSearch @focus="getList" @change="handleChangePlan">
                                    <a-select-option v-for="item in planList" :key="item.code + item.name" :value="item.id">
                                        ({{item.code}}){{item.name}}
                                    </a-select-option>
                                </a-select>
                            </a-col>
                            <a-col :span="6">
                                MRP运算方案：
                                未运算
                            </a-col>
                            <!-- <a-col :span="6">
                                单据来源：

                                <a-radio-group v-model="value" @change="choiceChange($event,value)">
                                    <a-radio :value="1" @click="choiceChange($event,1)">
                                        销售订单
                                    </a-radio>
                                    <a-radio :value="3" @click="choiceChange($event,3)">
                                        MPS主生产计划
                                    </a-radio>
                                </a-radio-group> -->



                                <!-- <a-checkbox @change="choiceChange($event,1)" :checked="saleOrder" :disabled="productionPlan">销售订单</a-checkbox>
                                <a-checkbox @change="choiceChange($event,3)" :checked="productionPlan" :disabled="saleOrder">MPS主生产计划</a-checkbox> -->
                                <!-- <a-checkbox>销售预测单</a-checkbox> -->
                            <!-- </a-col>
                            <a-col :span="6" class="text-center">
                                <span style="cursor:pointer;" @click="startOperation" v-if="permissions.includes('productionDemand:operation')">
                                    <a-button type="primary" style=""><a-icon type="caret-right" />开始运算</a-button>
                                </span>
                            </a-col> -->
                        </a-from>
                    </a-row>
                    <br />
                    <a-table :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :columns="columns" :customRow="customClick" :data-source="computedData" :pagination="false" bordered>
                        <template v-for="item in editColumnArraya" :slot="item" slot-scope="text, record ,index">
                            <div data-key="">
                                <editable-cell v-if="isRouterAlive" :text="text" :col="item" :index="index" :record="record" :dataSource="computedData" :unitsDataDetails="unitsDataDetails" :unitsAssistSelect="unitsAssistSelect" :dynamicAllData="dynamicFormData" :dynamicFormDataMap="dynamicFormDataMap"  @choiceAddData="choiceAddData(index,col,$event)" @change="onCellChange(index, col, $event)"  />
                            </div>
                        </template>
                    </a-table>
                </section>
            </div>

        </div>
        <drag-modal v-model="visible" @cancel="cancel" @ok="ok" :title="'选择' + modalTitle" :width="1100">
            <p>{{modalTitle}}表头</p>
            <div style="min-height:230px">
                <a-table :columns="columnsChoiceHeader" :data-source="saleOrderMain" bordered :pagination="false" :row-selection="rowSelectionMain" :scroll="{x:1000,y:260}">
                </a-table>
            </div>

            <p class="margin-top-10">{{modalTitle}}明细</p>
            <div style="min-height:230px">
                <a-table :columns="columnsChoiceDetails" :data-source="saleOrderDetail" bordered :pagination="false" :row-selection="rowSelectionDetails" :scroll="{x:1000,y:260}">

                </a-table>
            </div>
            <template slot="footer">
                <div>
                    <a-button type="primary" @click="ok">确认</a-button>
                    <a-button @click="cancel" class="margin-left-10">关闭</a-button>
                </div>
            </template>
        </drag-modal>
        <a-modal :visible="startVisible" :closable="false">
            <a-row :span="24" :gutter="[8,16]">
                <a-col :span="24" :push="8">
                    <a-spin v-show="runNewPercentage <= 20 " />
                    <a-icon v-show="runNewPercentage > 20 " type="check" style="color:#87d068;font-size:18px;font-weight:bold;" /> 整理物料
                </a-col>
                <a-col :span="24" :push="8">
                    <a-spin v-show="runNewPercentage > 20 && runNewPercentage <= 40 " />
                    <a-icon v-show="runNewPercentage > 40 " type="check" style="color:#87d068;font-size:18px;font-weight:bold;" /> 查询可用量
                </a-col>
                <a-col :span="24" :push="8">
                    <a-spin v-show="runNewPercentage > 40 && runNewPercentage <= 60 " />
                    <a-icon v-show="runNewPercentage > 60 " type="check" style="color:#87d068;font-size:18px;font-weight:bold;" /> 执行可用量分配
                </a-col>
                <a-col :span="24" :push="8">
                    <a-spin v-show="runNewPercentage > 60 && runNewPercentage <= 80 " />
                    <a-icon v-show="runNewPercentage > 80 " type="check" style="color:#87d068;font-size:18px;font-weight:bold;" /> 生成运算结果
                </a-col>
                <a-col :span="24" :push="8">
                    <a-spin v-show="runNewPercentage > 80 && runNewPercentage < 100 " />
                    <a-icon v-show="runNewPercentage >= 100 " type="check" style="color:#87d068;font-size:18px;font-weight:bold;" /> 生成建议数据
                </a-col>
                <a-progress style="height:10px;" :strokeWidth="10" :stroke-color="{from: '#108ee9',to: '#87d068',}" :percent="runNewPercentage" status="active" />
            </a-row>
            <template slot="footer">
                <a-button @click="handleCancel">
                    关闭
                </a-button>
            </template>
        </a-modal>
    </div>
</template>
<script>
import editableCell from "./workshop/editTable/EditableCell"
import pro from '@/mixins/procurement/pro'
import { list, saleOrderList, startOper, planList, code, mrpSave } from "@/api/production/productionMRP";
import { mapState } from "vuex";
export default {
    mixins: [pro],
    components: {
        editableCell,
    },
    data() {
        return {
            sourceCode: 'MrpOperation',
            showModel: 'order',
            //----------↓样式----------
            btnGrid: {
                xs: 2,
                sm: 2,
                md: 2,
                lg: 2,
                xl: 2
            },
            grid: {
                xs: 24,
                sm: 24,
                md: 12,
                lg: 8,
                xl: 8,
                xxl: 6
            },
            formLayout: "inline",
            fromStyle: { paddingTop: "8px" },
            labelCol: { span: 6 },
            wrapperCol: { span: 10 },
            editFalse: {
                borderBottom: '1px solid #ded7d7'
            },
            //----------↑样式----------
            editColumnArraya: [],//可编辑的字段
            isRouterAlive: true,
            mrpCode: null,
            columns: [{
                title: '序号',
                dataIndex: 'index',
                width: 50,
                customRender: (text, record, index) => {
                    return <span>{index+1}</span>
                },
                align: 'center'
            }, {
                title: '物料编码',
                dataIndex: 'inventoryCode',
            }, {
                title: '物料名称',
                dataIndex: 'inventoryName',
            }, {
                title: '规格型号',
                dataIndex: 'inventorySpecification',
            }, {
                title: '子件BOM',
                dataIndex: 'bomVersion',
                scopedSlots: { customRender: 'bomVersion' },
                width: 100,
            }, {
                title: '主计量',
                dataIndex: 'baseUnitName',
            }, {
                title: '数量',
                dataIndex: 'baseQuantity',
                align: 'right',
                customRender: (text, record, index) => {
                    return <span>{text.toFixed(2)}</span>
                },
            }, {
                title: '调整比例%',
                dataIndex: 'adjustProportion',
                width: 100,
                scopedSlots: { customRender: 'adjustProportion' },
            }, {
                title: '调整数量',
                dataIndex: 'adjustNumber',
                width: 100,
                scopedSlots: { customRender: 'adjustNumber' },
            }, {
                title: <div><span style="color:red;font-family: SimSun,sans-serif;font-size:14px">*</span>运算数量</div>,
                dataIndex: 'operationQuantity',
                width: 100,
                scopedSlots: { customRender: 'operationQuantity' },
            }, {
                title: '计划开始日期',
                dataIndex: 'planBeginDate'
            }, {
                title: '预计交货日期',
                dataIndex: 'deliveryDate'
            }],
            // planList: [],
            // planId: null,
            // visible: false,
            columnsChoiceHeader: [{
                title: '序号',
                dataIndex: 'index',
                width: 40,
                customRender: (text, record, index) => {
                    return <span>{index + 1}</span>
                },
                align: 'center'
            }, {
                title: '单据编号',
                dataIndex: 'voucherCode'
            }, {
                title: '单据日期',
                dataIndex: 'voucherDate'
            }, {
                title: '客户名称',
                dataIndex: 'crmName'
            }, {
                title: '业务员',
                dataIndex: 'salesmanName'
            }, {
                title: '收款方式',
                dataIndex: 'receiveType'

            }, {
                title: '订金金额',
                dataIndex: 'earnestMoney'

            }, {
                title: '制单人',
                dataIndex: 'createUserName'
            }],
            columnsChoiceDetails: [{
                title: '序号',
                dataIndex: 'index',
                width: 40,
                customRender: (text, record, index) => {
                    return <span>{index + 1}</span>
                },
                align: 'center'
            }, {
                title: '物料编码',
                dataIndex: 'inventoryCode'
            }, {
                title: '物料名称',
                dataIndex: 'inventoryName'
            }, {
                title: '规格型号',
                dataIndex: 'inventorySpecification'
            }, {
                title: '主计量',
                dataIndex: 'baseUnitName'
            }, {
                title: '数量',
                dataIndex: 'baseQuantity',
            }, {
                title: '计划开始日期',
                dataIndex: 'planBeginDate'
            }, {
                title: '预计交货日期',
                dataIndex: 'deliveryDate'
            }],
            computedData: [],//选中数据显示数据

            value: null,
            saleOrder: false,
            productionPlan: false,
            modalTitle: '',

            saleOrderMain: [],//销售订单表头
            saleOrderDetail: [],//销售订单明细

            selectedRowKeysMain: [],
            selectedRowKeysDetails: [],
            selectedRowsDetails: [],//选中的明细

            startVisible: false,
            startComputedData: [],//开始运算传递的参数


            //===========开始运算字段============
            runPercentage: 0,//运行的百分比
            runNewPercentage: 0,//当前运行百分比

            selectedRowKeys: [],
            selectedRowKeysList: []
        }
    },
    computed: {
        rowSelectionMain() {
            return {
                columnWidth: 40,
                selectedRowKeys: this.selectedRowKeysMain,
                onChange: this.onSelectChangeMain
            }
        },
        rowSelectionDetails() {
            return {
                columnWidth: 40,
                selectedRowKeys: this.selectedRowKeysDetails,
                onChange: this.onSelectChangeDetails
            }
        },
        ...mapState({
            userInfo: state => state.user.info,
            permissions: state => state.user.permissions,
        }),
    },
    created() {
        this.getList();
        this.getCode();
        this.editColumnArray(this.columns);
    },
    methods: {
        reload() {
            //强制刷新表格
            this.isRouterAlive = false;
            this.$nextTick(function () {
                this.isRouterAlive = true;
            });
        },
        //获取可编辑的列名
        editColumnArray(column) {
            let editcloumn = [];
            column.forEach((item, index) => {
                editcloumn.push(item.dataIndex);
            });
            this.editColumnArraya = editcloumn;
        },
        getCode() {
            //获取方案编码
            code().then(res => {
                if (res.code === 200) {
                    this.mrpCode = res.message;
                }
            }).catch(error => {

            })
        },
        getList() {
            //获取方案
            let data = {
                current: 1,
                size: -1,
            }
            list(data).then(res => {
                if (res.code === 200) {
                    const { records } = res.data;
                    this.planList = records;
                }
            })
        },
        handleChangePlan(value) {
            //选择方案
            this.planList.forEach(list => {
                if (list.id == value) {
                    if (this.startComputedData.mrpData) {
                        //如果先选择单据来源在选择方案的话
                        list.mrpData = this.startComputedData.mrpData;
                    }
                    this.startComputedData = list;
                }
            });
        },
        choiceChange(v) {
            //单据来源，选单
            console.log(e, v);
            this.selectedRowKeysMain = [];
            this.selectedRowKeysDetails = [];
            if (v == 1) {
                // if (e.target.checked) {
                    //销售订单
                    saleOrderList().then(res => {
                        if (res.code === 200) {
                            console.log('销售订单：', res)

                            this.visible = true;
                            this.modalTitle = '销售订单';
                            this.saleOrder = true;
                            this.productionPlan = false;

                            if (res.data.saleOrderMain.length > 0) {
                                res.data.saleOrderMain.forEach(item => {
                                    item.key = item.id;
                                });
                            }
                            if (res.data.saleOrderDetail.length > 0) {
                                res.data.saleOrderDetail.forEach(item => {
                                    item.key = item.id;
                                    item.voucherType = 1;//预算单据类型
                                    item.code = this.mrpCode;
                                    item.operationQuantity = item.baseQuantity;//运算数量
                                    item.voucherId = item.id;
                                });
                            }
                            this.saleOrderMain = res.data.saleOrderMain;
                            this.saleOrderDetail = res.data.saleOrderDetail;
                        }
                    })
                // } else {
                //     this.saleOrder = false;
                //     this.selectedRowKeysMain = [];
                //     this.selectedRowKeysDetails = [];
                //     if (this.computedData.length > 0) {
                //         this.computedData = this.computedData.filter(item => item.voucherType != 1);

                //         this.$set(this.startComputedData, 'mrpData', this.computedData);
                //     }
                // }
            }
            if (v == 3) {
                //主生产计划
                // if (e.target.checked) {
                    planList().then(res => {
                        if (res.code === 200) {
                            console.log('mps主生产计划', res)
                            this.visible = true;
                            this.modalTitle = 'MPS主生产计划';
                            this.saleOrder = false;
                            this.productionPlan = true;

                            if (res.data.saleOrderMain.length > 0) {
                                res.data.saleOrderMain.forEach(item => {
                                    item.key = item.id;
                                });
                            }
                            if (res.data.saleOrderDetail.length > 0) {
                                res.data.saleOrderDetail.forEach(item => {
                                    item.key = item.id;
                                    item.voucherType = 3;//预算单据类型
                                    item.code = this.mrpCode;
                                    item.operationQuantity = item.baseQuantity;//运算数量
                                    item.voucherId = item.id;
                                    item.deliveryDate = item.planEndDate
                                });
                            }
                            this.saleOrderMain = res.data.saleOrderMain;
                            this.saleOrderDetail = res.data.saleOrderDetail;
                        }
                    })
                // } else {
                //     this.productionPlan = false;
                //     this.selectedRowKeysMain = [];
                //     this.selectedRowKeysDetails = [];
                //     if (this.computedData.length > 0) {
                //         this.computedData = this.computedData.filter(item => item.voucherType != 3);
                //         this.$set(this.startComputedData, 'mrpData', this.computedData);
                //     }
                // }
            }
        },
        onSelectChangeMain(keys, rows) {
            console.log(keys, rows)
            //选单表头table
            this.selectedRowKeysMain = keys;

            let detailsKeys = [];

            this.saleOrderDetail.forEach(d => {
                rows.forEach(r => {
                    if (d.orderId == r.id) {
                        detailsKeys.push(d.id);
                    }
                });
            });
            detailsKeys = [...new Set(detailsKeys)]
            this.selectedRowKeysDetails = detailsKeys;
        },
        onSelectChangeDetails(keys, rows) {
            //选单明细table
            console.log(keys, rows)
            this.selectedRowKeysDetails = keys;

            this.selectedRowsDetails = rows;

            //选中明细同时表头也要选中
            let mainKeys = [];
            rows.forEach(r => {
                mainKeys.push(r.orderId)
            });
            mainKeys = [...new Set(mainKeys)]
            this.selectedRowKeysMain = mainKeys;
        },
        onSelectChange(selectedRowKeys,rows) {
            this.selectedRowKeys = [...selectedRowKeys]
            this.dataSource.forEach(i => {
                rows.forEach(j => {
                    if (i.id === j.id) {
                        arr.push(i)
                    }
                })
            })
            this.selectedRowKeysList = [...new Set(rows)]
        },
        cancel() {
            this.visible = false;
        },
        ok() {
            this.selectedRowsDetails = [];
            this.saleOrderDetail.forEach(item => {
                this.selectedRowKeysDetails.forEach((details, index) => {
                    if (item.id == details) {
                        this.selectedRowsDetails.push(item);
                    }
                });
            });
            //保存选中需要计算的明细
            if (this.selectedRowsDetails.length < 1) {
                this.$message.warning('请选中一条或多条数据');
                return
            } else {
                this.computedData = this.selectedRowsDetails.map((item, index) => {
                    return {
                        ...item,
                        index: index
                    }
                });

                this.computedData.forEach(element => {
                    delete element.id;
                });
                this.$set(this.startComputedData, 'mrpData', this.computedData);
                console.log('选中的明细', this.startComputedData);
                this.editMask = false;
                this.voucherState = -1;
                this.visible = false;
                this.showModel = 'order'
            }
        },
        startOperation() {
            //开始运算
            console.log(this.startComputedData);
            this.runNewPercentage = 0;

            if (!this.startComputedData.id) {
                this.$message.warning('请选择MRP运算方案');
                return;
            }

            let reportData = JSON.parse(JSON.stringify(this.startComputedData.mrpData));

            if (!reportData) {
                this.$message.warning('请选择单据来源');
                return;
            }

            if (reportData.length < 1) {
                this.$message.warning('请选择单据来源');
                return;
            }

            for (let i = 0; i < reportData.length; i++) {
                if (reportData[i].operationQuantity == null || reportData[i].operationQuantity == '') {
                    this.$message.warning('运算数量必须填写');
                    return;
                }
            }

            this.startVisible = true;
            let timer = setInterval(() => {
                this.runNewPercentage += Math.round(Math.random());
                if (this.runNewPercentage >= 98) {
                    clearInterval(timer)
                }
            }, 50)

            startOper(this.startComputedData).then(res => {
                if (res.code === 200) {
                    this.runNewPercentage = 100;
                    this.clerarData();
                    setTimeout(() => {
                        this.handleCancel();
                        this.$router.push({
                            // path: '/production/productionAdvice',
                            path:'/production/management/productionOrder'

                        })
                        this.$store.commit('SET_MRP', res.data);
                    }, 500);
                }
            }).catch(err => {
                // this.$message.error(err);
                this.handleCancel();
            })

        },
        clerarData() {
            //清空所有数据
            // this.startComputedData = [];
            this.startComputedData.mrpData = [];
            this.computedData = [];//列表
            this.saleOrder = false;
            this.productionPlan = false;
            this.saleOrderMain = [];//销售订单表头
            this.saleOrderDetail = [];//销售订单明细

            this.selectedRowKeysMain = [];
            this.selectedRowKeysDetails = [];
        },
        handleCancel() {
            //运算弹窗关闭
            this.startVisible = false;
        },
        submitServer(){
            const params = {
                ...this.computedData[0],
                "maMrpOperationDetailList": this.computedData,
            }
            mrpSave(params).then(res => {
                if(+res.code === 200) {
                   this.$message.success('保存成功')
                   this.editMask = true;
                   this.voucherState = -1;
                } else {
                    this.$message.warning('保存失败')
                    this.computedData = []
                }
            })
        },
        submitOrder(){},
        onCellChange(indexTable, dataIndex, value) {
            const computedData = [...this.computedData];
            const target = computedData.find((item, index) => index === indexTable);
            console.log(target, dataIndex, value, indexTable, '1212112212');

            this.$set(target, dataIndex, value)
            // if (dataIndex == 'workCode' || dataIndex == 'workName') {
            //     //工序编码
            //     if (value) {
            //         target['workCode'] = value.code;
            //         target['workId'] = value.id;
            //         target['workName'] = value.name;
            //         target['processMethod'] = value.processMethod;
            //     } else {
            //         target['workCode'] = null;
            //         target['workId'] = null;
            //         target['workName'] = null;
            //         target['processMethod'] = null;
            //     }

            // } else if (dataIndex == 'inventoryCode' || dataIndex == 'inventoryName') {
            //     //子件编码
            //     if (value) {
            //         target['inventoryCode'] = value.inventoryCode;
            //         target['inventoryId'] = value.id;
            //         target['inventoryName'] = value.inventoryName;
            //         target['specification'] = value.inventorySpecification;
            //         target['unitName'] = value.unitName ? value.unitName : value.unitGroupName;
            //         target['unitId'] = value.unitId ? value.unitId : value.unitGroupId;

            //         //置空当前子件数据
            //         target['bomVersion'] = null;
            //         target['bomId'] = null;
            //         target['requireQuantity'] = null;
            //         target['remarks'] = null;
            //         target['supplyType'] = null;

            //     } else {
            //         target['inventoryCode'] = null;
            //         target['inventoryId'] = null;
            //         target['inventoryName'] = null;
            //         target['specification'] = null;
            //         target['unitName'] = null;
            //         target['unitId'] = null;
            //     }
            // } else if (dataIndex == 'bomVersion') {
            //     //查询下级bom(子件bom)
            //     if (value) {
            //         target['bomVersion'] = value.versionCode;
            //         target['bomId'] = value.id;
            //     } else {
            //         target['bomVersion'] = null;
            //         target['bomId'] = null;
            //     }
            // } else if (dataIndex == 'adjustProportion' || dataIndex == 'adjustNumber' || dataIndex == 'operationQuantity') {
            //     //调整比例，调整数量，运算数量
            //     console.log(value);
            //     if (dataIndex == 'adjustProportion') {
            //         if (value) {
            //             //运算数量=数量 *（调整比例/100）
            //             target['adjustNumber'] = (Number(target.baseQuantity) * (value / 100)).toFixed(2);
            //             target['operationQuantity'] = (Number(target['adjustNumber']) + Number(target.baseQuantity)).toFixed(2);
            //         }
            //     }
            //     if (dataIndex == 'adjustNumber') {
            //         if (value) {
            //             //调整比例=数量/调整数量 * 100
            //             target['adjustProportion'] = (value / Number(target.baseQuantity) * 100).toFixed(2);
            //             target['operationQuantity'] = (Number(target['adjustNumber']) + Number(target.baseQuantity)).toFixed(2);
            //         }
            //     }

            //     if (dataIndex == 'operationQuantity') {
            //         if (value) {
            //             //调整比例=数量/调整数量* 100
            //             target['adjustNumber'] = (value - Number(target.baseQuantity)).toFixed(2);
            //             target['adjustProportion'] = ((target['adjustNumber'] / Number(target.baseQuantity)) * 100).toFixed(2);
            //         }
            //     }

            // } else {
            //     this.$nextTick(() => {
            //         target[dataIndex] = value;
            //     });
            // }

            this.$nextTick(() => {
                this.computedData = computedData;
                console.log('明细数据：', this.computedData)
                this.reload();
            })

        },
    }
}
</script>
<style lang="less">
@import "~@/style/purchase/voucher.less";
.demand-content {
    padding: 10px;
    height: calc(100% - 45px);
    font-size: 14px;
    color: rgba(0, 0, 0, 0.65);
    overflow-y: auto;
    .ant-form-inline .ant-form-item {
        display: block;
    }
    .order-dynamic-form-wrapper {
        margin-top: 20px;
        label:not(.form-check-label):not(.custom-file-label) {
            font-weight: normal;
        }
        .ant-form-item-label,
        .ant-form-item-control {
            line-height: 32px;
        }
        .ant-form-item {
            margin-bottom: 0;
        }
    }
}
</style>
